﻿using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using GalaSoft.MvvmLight.Messaging;
using Microsoft.Phone.Controls;

namespace FastestWays.Views
{
    public partial class AddressesSearch : PhoneApplicationPage
    {
        public AddressesSearch()
        {
            InitializeComponent();
            this.Loaded += MainPageLoaded;

            //List<string> myContent = new List<string>(){"cool content", "working content"};
            
            //expndrLatest.ItemsSource = myContent;
        }

        private void MainPageLoaded(object sender, RoutedEventArgs e)
        {
            Messenger.Default.Register<MessageBase>
                    (
                        this,
                        (action) => ReceiveMessage(action)
                    );
            
        }

        private void ReceiveMessage(MessageBase action)
        {
            NavigationService.GoBack();
        }

        private void OnTextBoxTextChanged(object sender, TextChangedEventArgs e)
        {
            TextBox textBox = sender as TextBox;
            // Update the binding source
            BindingExpression bindingExpr = textBox.GetBindingExpression(TextBox.TextProperty);
            bindingExpr.UpdateSource();
        }

       
    }
}